<!DOCTYPE html>
<html>
<head>
    <!-- extend from header layout -->
    {% include "common/header.html" %}
    <link href="/static/plugins/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet">
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="row">
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <form class="form-horizontal" id="commentForm">
                    {{ form.hidden_tag() }}
                    <input id="id" name="id" type="hidden" class="form-control" value="{{ resource.id if resource }}">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Resource Code：</label>
                        <div class="col-sm-8">
                            <input id="resource_code" name="resource_code" minlength="4" type="text" class="form-control" required="" aria-required="true" value="{{ resource.resource_code if resource }}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Parent Code：</label>
                        <div class="col-sm-8">
                            <select id="parent_code" name="parent_code" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="Search">
                                <option value="0">Parent Resource</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Resource Level：</label>
                        <div class="col-sm-8">
                            <select id="resource_level" name="resource_level" class="selectpicker form-control">
                                <option value="0">0</option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Resource Name：</label>
                        <div class="col-sm-8">
                            <input id="resource_name" name="resource_name" minlength="2" type="text" class="form-control" required="" aria-required="true" value="{{ resource.resource_name if resource }}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Resource URL：</label>
                        <div class="col-sm-8">
                            <input id="resource_url" name="resource_url" type="text" class="form-control" required="" aria-required="true" value="{{ resource.resource_url if resource }}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Describe：</label>
                        <div class="col-sm-8">
                            <textarea id="describe" name="describe" class="form-control" required="" aria-required="true">{{ resource.describe if resource }}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-3 col-sm-8">
                            <button id="btn-reset" type="button" class="btn btn-warning"><strong>Reset</strong></button>
                            <button type="submit" class="btn btn-primary"><strong>Submit</strong></button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!-- End Panel Other -->
</div>
</body>

<!-- extend from script layout -->
{% include "common/script.html" %}
<!-- 自定义js -->
<script src="/static/js/content.js?v=1.0.0"></script>
<!-- jQuery Validation plugin javascript-->
<script src="/static/plugins/validate/jquery.validate.min.js"></script>
<script src="/static/plugins/validate/messages_es.js"></script>
<!-- Bootstrap -->
<script src="/static/plugins/bootstrap-select/js/bootstrap-select.min.js"></script>
<script src="/static/plugins/bootstrap-select/js/i18n/defaults-zh_CN.min.js"></script>
<!-- Blog -->
<script>
    var operation = "{{ operation if operation }}";
    var parent_code = "{{ resource.parent_code if resource }}";
    var resource_level = "{{ resource.resource_level if resource }}";
</script>
<script src="/static/js/moment-with-locales.js"></script>
<script src="/static/js/security/resource-edit.js"></script>
</html>